<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions"  prefix="fn"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<html>  
<head>  
<base href="<%=basePath%>">
 <meta http-equiv="Content-Type" content="text/html; charset=gb2312">  
<script src="js/jquery-1.11.3.min.js"></script>
<script type="text/javascript">  
   function upload(){  
       $('form').submit();  
       $('img').attr('src','img/vote_img_loading.png')  
   }  
      
   function disable(path){
	   var pathone = path;
	   var pathwo = "/usr/local/tomcat/tomcat8/webapps"+pathone;
	   var params ={filepath:pathwo}
	   $.ajax({
		   url:"${path}/bassm/user/UserInformationFist",
			data:params,
			type:"post",
			async:false,
			success:function(date){
				if(date==1){
					alert("图片正确")
					$('img').attr('src',path).next('span').css('visibility','visible');
				}else{
					alert("资料有误重新输入")
				}
			},
			error:function(){
				alert("数据有误");
			}
	   });
       
         
   }  
</script>  
<style type="text/css">  
.pic {  
    position: relative;  
    width: 200px;  
    height: 200px;  
    display: inline;  
    margin: 0 5px 0 0;  
    cursor: pointer;  
    overflow: hidden;  
}  
  
.pic span {  
    position: relative;  
    border-color: #f0f0f0;  
    margin: -20px 0 0;  
    display: block;  
    height: 40px;  
    width: 200px;  
    text-align: center;  
    overflow: hidden;  
    line-height: 50px;  
    background: url(img/template_list_titlebg.png) ;  
}    
</style>
<script type="text/javascript">
    	$(function(){
    		$("#add").click(function(){
    				var name=$("#yname").val();
					var sex=$("#ysex").val();
					var phone=$("#yphone").val();
					var detailed=$("#ydetailed").val();
					var sfzid=$("#ysfzid").val();
    				var urlimgfist = document.getElementById('imgfinst').src;
    				var params= {urlimgfisto:urlimgfist,name:$("#yname").val(),phone:$("#yphone").val(),detailed:$("#ydetailed").val(),sex:$("#ysex").val(),sfzid:$("#ysfzid").val()};
    				//判断上传要求
    				if(name == ""){
    					alert("请输入姓名");
    				}else if(detailed == ""){
    					alert("请输入单元楼");
    				}else if(sfzid == ""){
    					alert("请输入身份证");
    				}else if(phone == ""){
    					alert("请输入电话号码");
    				}else{
    				$.ajax({
	    				url:"${path}/bassm/user/UserImgFistToto",
	    				data:params,
	    				type:"post",
	    				async:false,
	    				success:function(date){
	    					if(date==1){ 
	    						alert("保存成功");
	    						window.location.href = "${path}/bassm/user/showMyProduct";
							}else{
								alert("资料有误重新输入")
							}
	    				},
	    				error:function(){
	    					alert("数据加载失败");
	    				}
	    			});
    				}
    		});
    		
    	});
    
    </script>
</head>  
<body style="margin:0px"> 
	<div align="center" >
	<div >
	<table>
	<td>
	<span style="width: 60px; height: 30px; color: white;font-size: 21;color:#4F4F2F;" >注册用户</span>
	</td>
	<td style="width: 800px"></td>
	<td>
	<a href="${path}/bassm/user/showMyProduct" rootun" style="width: 60px; height: 40px; color: white; font-size: 20;color:#4F4F2F;">返回列表······</a>
	</td>
	</table>
	
	</div>
	<div>
		<div style="background-color: #f0f0f0;">
		<table>
			<tr>
		<td>
				<form id="addform" method="post" enctype="multipart/form-data" >
    		<table border="0"  cellpadding="0" cellspacing="0" >
    		<tr>
    			<td></td>
    			<td>
    		    <div align="center">  
       				<img  id="imgfinst" name ="imgfinst" height="200" width="200" src="img/update_pic.png" >
   				</div>
				<td>
    		</tr>
    		<tr>
	    		<td height="85" align="right">姓名 :</td>
	    		<td colspan="2" align="left">
	    			<input type="text" name="yname" id="yname" value="" style="width: 270px; height: 40px;"/>
	    		</td>
	    		
    		</tr>
    		<tr>
	    		<td height="85" align="right">性别 :</td>
	    		<td colspan="2" align="left">
	    			<select name="ysex"  id ="ysex" style="width: 270px; height: 40px;">
	    				<option>男</option>
	    				<option>女</option>
	    			</select>
	    		</td>
    		</tr> 
    		<tr>
    		<td height="85" align="right">手机号码:</td>
	    		<td  colspan="2" align="left">
	    			<input type="text" name="yphone" id="yphone"   style="width:270px; height:40px;" />
	    		</td>
    		</tr>
    		<tr>
    		<td height="85" align="left">身份证号码:</td>
	    		<td  colspan="2" align="left">
	    			<input type="text" name="ysfzid" id="ysfzid"   style="width:270px; height:40px;" />
	    		</td>
    		</tr> 			
    		<tr>
	    		<td height="85" align="left">单元/楼/室:</td>
	    		<td  colspan="2" align="left">
	    			<input type="text" name="ydetailed" id="ydetailed" value="" style="width:270px; height:40px;"/>
	    		</td>
    		</tr>
    		<tr align="right" >
    			<td></td>
    			<td colspan="3" height="75px;" align="center">
    				<input  type="button" id="add" value="提交" style=" border:0;width: 114px; height: 38px;  color: white; font-size: 20px;background:url(img/13.jpg) no-repeat;"/>
    			</td>
    			
    		</tr>
    		</table>
    		</form>
				
		</td>
		<td style="width: 100PX"></td>
		<td>
				<form style=" overflow-y:auto;  height: 660px; width: 265px;float:left;">
   				<table border="1" cellpadding="0" cellspacing="0" align="center" >
    			<tr align="center" height="50" style="background-color:2082D5; color:white;">
    			<td width="100">头像</td>
    			<td width="80">操作</td>
    			</tr>
    			<c:forEach var="v" items="${push}">
	    			<tr align="center" style="background-color:#f0f0f0;">
	    			<td><img alt="" src="${v.scenePath}" width="100" height="100" ></td>
	    			<td>
	    			<input type="button" onclick="disable('${v.scenePath}') "  id="addbmd" value="添加" style="width: 40px; height: 33px; background-color: #44BB44;color: white;">
	    			</td>
	    			</tr>    	
    			</c:forEach>
    			</table>
    			</form>
		</td>	
			</tr>
		</table>
     	</div>
   </div>
     <p style="font-size: 15">咨询电话：0755-86133729　　公司地址：广东省深圳市龙华新区留仙大道24号彩悦大厦10楼</p>
  	<p style="font-size: 15">&copy;   2013-2015深圳市万物联有限公司版权所有　丨　粤ICP备13071979号-2</p>
  </div>
</body>  
</html>  